public class customLayout {

    private ApexPages.StandardController stdController;
    public Mi_Objeto__c Mi_Objeto {get;set;}
    
    public customLayout(ApexPages.StandardController controller) {

        this.stdController=controller;
        this.Mi_Objeto=(Mi_Objeto__c)stdController.getRecord();
    }
    
    public PageReference saveNew()
    {
        stdController.save();
    
        Schema.DescribeSObjectResult describeResult = stdController.getRecord().getSObjectType().getDescribe();
        PageReference pr = new PageReference('/' + describeResult.getKeyPrefix() + '/e');
        pr.setRedirect(true);
        return pr;
    }
    
    public PageReference save()
    {
        return (new ApexPages.StandardController(Mi_Objeto)).save();
    }
    

}